package homework.homework03;

import javax.swing.*;
import java.util.Scanner;

public class RemoteControl {
    //定义成员变量记录TV对象
//    private TV tv;
    private Scanner scanner = new Scanner(System.in);
    //空参构造
/*    public RemoteControl(){

    }*/

 /*   //获取TV对象
    public RemoteControl(TV tv){
        this.tv = tv;
    }*/

    //成员方法,实现题目要求
    public void controlTV(TV tv){
        System.out.println("遥控器控制电视");
        //提示输入
        System.out.println("请输入电视节目信息");
        String tvName = scanner.next();
        tv.play(tvName);
    }

}
